iverilogfandomcom-20200214-history
Installation Guide
Icarus may be installed from source code or from pre-packaged binary distributions. __TOC__ = Installation From Source = Icarus is developed for Unix-like environments but can also be compiled on Windows systems using Cygwin environment or Mingw compilers. The following instructions are the common steps for obtaining the Icarus Verilog source, compiling and installing. Note that there are precompiled and/or prepackaged versions for a variety of systems, so if you find an appropriate packaged version, then that is the easiest way to install. Obtaining Snapshots The ftp site for the latest snapshot is ftp://ftp.icarus.com/pub/eda/verilog/snapshots. Download a tarball with a name such as verilog-version.tar.gz and un-tar it using: % tar -zxvf verilog-''version''.tar.gz This will create a directory, similar to the name of the tarball, such as verilog-version. Change into this directory using: % cd verilog-''version'' The source is then compiled and installed in the manner appropriate for your operating system. See below. Obtaining Source From git : Note: Icarus Verilog uses git version 1.5. It is recommended that you too use git 1.5 or later for accessing the Icarus Verilog repository. I have witnessed git 1.4 being confused by git 1.5 formats. The source code for Icarus is stored under the git source code control system. You can use git to get the latest development head or the latest of a specific branch. Stable releases are placed on branches, and in particular the v0.8 stable releases are on the branch "v0_8-branch" To get the development version of the code follow these steps: % git config --global user.name "Your Name Goes Here" % git config --global user.email you@yourpublicemail.example.com % git clone git://icarus.com/~steve-icarus/verilog The first two lines are optional and are used to tell git who you are. This information is important if/when you submit a patch. We suggest that you add this information now so you don't forget to do it later. The clone will create a directory, named verilog, containing the source tree, and will populate that directory with the most current source from the HEAD of the repository. Change into this directory using: % cd verilog Normally, this is enough as you are now pointing at the most current development code, and you have implicitly created a branch "master" that tracks the development head. However, If you want to actually be working on the v0_9-branch (the branch where the latest v0.9 patches are) then you checkout that branch with the command: % git checkout --track -b v0_9-branch origin/v0_9-branch This creates a local branch that tracks the v0_9-branch in the repository, and switches you over to your new v0_9-branch. The tracking is important as it causes pulls from the repository to re-merge your local branch with the remote v0_9-branch. You always work on a local branch, then merge only when you push/pull from the remote repository. :(The v0_9-branch is the current code for the v0.9 release series. See the GIT Branch Summary for more about the branches that are available, and more about how to work with branches.) Now that you've cloned the repository and optionally selected the branch you want to work on, your local source tree may later be synced up with the development source by using the git command: % git pull The git system remembers the repository that it was cloned from, so you don't need to re-enter it when you pull. Finally, configuration files are built by the extra step: % sh autoconf.sh The source is then compiled as appropriate for your system. See the specific build instructions below for your operation system for what to do next. You will need autoconf and gpref installed in order for the script to work. If you get errors such as: Autoconf in root... autoconf.sh: 10: autoconf: not found Precompiling lexor_keyword.gperf autoconf.sh: 13: gperf: not found. You will need to install download and install the autoconf and gperf tools. Note: The icarus.com URL is for the master version of the git repository, but there is a mirror at git://github.com/steveicarus/iverilog.git. The mirror is updated daily, so there may be some delay. Icarus Specific Configuration Options Icarus takes many of the standard configuration options and those will not be described here. The following are specific to Icarus: --enable-suffix=suffix This option allows the user to build Icarus with a default suffix or when provided a user defined suffix. Older stable releases have this flag on by default e.g.(V0.8 by default will build with a "-0.8" suffix). All versions have an appropriate default suffix ("-"). All programs or directories are tagged with this suffix. e.g.(iverilog-0.8, vvp-0.8, etc.). The output of iverilog will reference the correct run time files and directories. The run time will check that it is running a file with a compatible version e.g.(you can not run a V0.9 file with the V0.8 run time). --with-valgrind This option adds extra memory cleanup code and pool management code to allow better memory leak checking when valgrind is available. This option is not need when checking for basic errors with valgrind. Compiling on Linux/Unix (Note: You will need to install bison, flex, and g++) This is probably the easiest case. Given that you have the source tree from the above instructions, the compile and install is generally as simple as: % ./configure % make (su to root) # make install The "make install" typically needs to be done as root so that it can install in directories such as "/usr/local/bin" etc. You can change where you want to install by passing a prefix to the "configure" command: % ./configure --prefix=/my/special/directory This will configure the source for eventual installation in the directory that you specify. Note that "rpm" packages of binaries for Linux are typically configured with "--prefix=/usr" per the Linux File System Standard. Compiling on Macintosh OS X Since Mac OS X is a BSD flavor of Unix, you can install Icarus Verilog from source using the procedure described above. You need to install the Xcode software, which includes the C and C++ compilers for Mac OS X. The package is available for free download from Apple's developer site. Once Xcode is installed, you can build Icarus Verilog in a terminal window just like any other Unix install. Compiling on Solaris Solaris is a form of Unix, so the Unix instructions above generally apply. However, a Solaris user will need to install some other compilation tools: * gnu make Solaris includes a BSD-style make, but Icarus Verilog uses some GNU make extensions. It is conventional on a Solaris system to install GNU make as "gmake". * gcc As of this writing, Icarus Verilog will not compile with the SUN C++ compiler. It is not a language issue, but a tools flags problem. The Makefiles pass flags to the compiler that gcc understands for making shared objects, etc. * bison/flex These tools are gnu replacements for yacc/lex. They are extended versions of their older counterparts. These tools are commonly available for Solaris. (SUN used to distribute a CD that included these and other GNU tools precompiled and prepackaged. Can anybody confirm that they still have such a disk?) Compiling on MS Windows (MinGW) The source as available above can also be compiled on MS Windows systems. The preferred method for compiling on Windows is to use the mingw32 compiler. The source tree has detailed instructions for configuring/compiling in the text file "mingw.txt". Be warned, compiling for Windows is somewhat painful (mostly because you also have to setup a compilation environment), though using a recent version of MinGW/MSYS with the appropriate tools allows Icarus to be built like Linux/Unix. Also note that because of deficiencies/differences in the MS libraries some of the test suite tests will fail. These fails can be grouped into the following categories: three vs two digit exponents for real values (%e/%g), no support for -0, infinity/NaN are displayed differently, %#g gives an extra digit for 0.0. These have all been reported to the MinGW developers and for the most part do not change the validity/value of the result. One of the VPI tests also fails. It appears that stdout/stderr do not behave the same as on other systems. The output for the test is out of order. This problem has not been investigated or reported to the MinGW developers. Compiling on MS Windows (Cygwin) Cygwin users should preferably use the mingw32 method to compile Icarus Verilog. Programs compiled by mingw32 are perfectly usable under Cygwin, like any other Windows binary, so mingw32 builds are the preferred distribution form. However, there are practical reasons to compile directly under Cygwin: file path handling and fully compatible test suite output. Be warned that the Cygwin binary is noticeably slower than the MinGW compiled binary, so there is a trade off of compatibility vs speed of simulation. In a Cygwin command line follow the instructions for Linux/Unix. The instructions are the same, as Cygwin is an attempt to be Unix under Windows. In order to compile/install Icarus using Cygwin the following packages must be installed: binutils, g++, autoconf, automake, make, flex, bison, gperf, libbz2-devel (otherwise system.vpi won't build) They should all be available via the Cygwin setup program. The ghostscript package (to get ps2pdf) is optional, but since Cygwin has a working "man" system, the man pages will be installed into a Cygwin system and ps2pdf is not required. = Installation From Premade Packages = The various operation systems and distributions have various package management systems, and there are prepackaged distributions of Icarus Verilog available for some of them. If there is a prepackaged version that is suitable for your system and needs, then prepackaged installs are the easiest. RPM Based Systems On systems that use RPM Package Manager (RPM) software packages, Icarus Verilog may be installed from a binary RPM package. If no binary RPM package is available for your system, then one can be easily made from a source RPM package. Building a Binary RPM Package Source RPM packages are generally available at the same site where the source tarballs are hosted, and have the suffix ".src.rpm". Once downloaded, a binary RPM package can be built using: % rpmbuild --rebuild verilog-''version''.src.rpm (Older RPM Based Systems that do not have rpmbuild use rpm to build the binary packages.) This compiles the source RPM package and makes a binary RPM package tailored for your system. The generated package is placed where you configured rpm to place built packages: often "/usr/src/rpm/RPMS". (NOTE: Building packages may require that you include other packages (notably ''-devel'' packages) that are not otherwise needed.) Installing a Binary RPM Package Binary RPM packages, downloaded or built using the instructions above, can be installed with the following command (run as root): # rpm -Uvh verilog-''version''.type.rpm If you are using yum (Yellow dog Updater) as your RPM package updater/installer/remover, then you can install a downloaded or built binary RPM package with the following command (run as root): # yum -y localinstall verilog-''version''.type.rpm SuSE Linux/openSUSE Introduction The openSUSE build service has now a web interface that allows to search for packages. To find Icarus Verilog RPM packages go to the web page http://software.opensuse.org/search, select your version of the distribution and enter the search term verilog. Starting with openSUSE 10.3 the distribution supports a 1-Click install feature, allowing to start the installation by selecting the 1-Click link on the web page. The 1-Click install feature will add the repository as to the list of installation sources. If you have an older version and not the 1-Click install feature installed, you can add the repository manually to your install source by following the instructions in the section below. Stable Version Werner Hoch provides a "yum" repository with a variety of EDA packages, including the stable releases of Icarus Verilog and GTKWAVE. The easiest way to use this repository is via "YaST". * Start the YaST Control Center application, normally from your start menu. * Select "Installation Source" to add the new repository. * In the Installation Source control panel, select Add-->FTP to add a new FTP source. * The FTP server is ftp-1.gwdg.de * The Directory is one of these (select based on the system you have): ** /pub/opensuse/repositories/home:/werner2101/SUSE_Linux_9.3 ** /pub/opensuse/repositories/home:/werner2101/SUSE_Linux_10.0 ** /pub/opensuse/repositories/home:/werner2101/SUSE_Linux_10.1 ** /pub/opensuse/repositories/home:/werner2101/openSUSE_10.2 * Click "OK" in the Add... dialog to add the repository, and * Click "Finish" to finish adding the installation source. Now you can use the YaST "Software Management" control to add the "verilog" package, which is Icarus Verilog. An alternate mirror of this repository is here: * The HTTP server is software.opensuse.org * The directory is one of these (select based on the system you have): ** /download/home:/werner2101/SUSE_Linux_9.3 ** /download/home:/werner2101/SUSE_Linux_10.0 ** /download/home:/werner2101/SUSE_Linux_10.1 ** /download/home:/werner2101/openSUSE_10.2 Development Snapshot Development snapshots are available from: http://software.opensuse.org/download/home:/dannori/ or the mirror: ftp://ftp-1.gwdg.de/pub/opensuse/repositories/home:/dannori Ubuntu Linux This needs testing! See the discussion tab. The Ubuntu Universe repository has the Icarus Verilog .deb package. To install Icarus Verilog follow the steps below * Add the Universe repository in /etc/apt/sources.list using your favourite text editor (It would already be there but would have been commented). In Edgy Eft,the line would be something like deb http://archive.ubuntu.com/ubuntu/ edgy universe deb-src http://archive.ubuntu.com/ubuntu/ edgy universe * Run sudo apt-get update from terminal. * Run sudo apt-get install verilog Installing verion 0.9.1 from a launchpad PPA repository Edit the list of available repositories (sudo access password required) $ sudo gedit /etc/apt/sources.lst and add the new repository (change the distribution name as appropriate) ## PPA for Icarus Verilog deb http://ppa.launchpad.net/team-electronics/ppa/ubuntu jaunty main deb-src http://ppa.launchpad.net/team-electronics/ppa/ubuntu jaunty main Add the repository key to the system to avoid warnings $ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 7FE97A0D3D7F2EA1 Update the local repository cache $ sudo apt-get update Install (update) the Icarus Verilog package $ sudo apt-get install verilog Macintosh OS X Icarus Verilog can be easily installed on Mac OS using either the MacPorts or Fink package managers. MacPorts Instructions for downloading and installing MacPorts can be found here. Once MacPorts is installed and configured, Icarus Verilog can be installed in a terminal window using: % sudo port -d -v install iverilog GTKWave (the waveform viewer) can also be installed via MacPorts: % sudo port -v install gtkwave Fink Instructions for downloading and installing Fink can be found here. TBD FreeBSD Icarus Verilog can be used without a problem on FreeBSD-based systems. It is very simple to install and get it working. The fastest way is to use FreeBSD Ports collection. FreeBSD Ports FreeBSD Ports collection includes Icarus Verilog as a port of it's base package. FreeBSD Ports collection normally is put under /usr/ports hierarchy. Installation (as root--unless you've done some customization): % # cd /usr/ports/cad/iverilog && make install clean Now, you should be able to use "iverilog". If you use csh(1) shell, remember to type: % rehash In case of having no /usr/ports directory, you'll have to fetch it by yourself. The easiest way is to copy /usr/share/examples/cvsup/ports-supfile to some other location: % cp /usr/share/examples/cvsup/ports-supfile ~/csup-ports Edit this file to change "CHANGE_THIS.FreeBSD.org" to appropriate FreeBSD mirror, and start downloading: # csup -L 2 ~/csup-ports This will take some time and disk space. It's about downloading all Ports. For more information, visit FreeBSD Handbook, especially Installing Applications: Packages and Ports section. Windows Windows binaries wrapped in a handy installer is Pablo Bleyer Kocik's page "Icarus Verilog for Windows". This page makes available installers mainly for the most recent stable versions. Simply download the version of choice and execute the installer.